const { uniPostcssPlugin } = require('@dcloudio/uni-cli-shared')

module.exports = {
    plugins: [
        uniPostcssPlugin(),
        require('autoprefixer')(),
        require("tailwindcss")({ config: require("./tailwind.config") }),
        ...(
            process.env.UNI_PLATFORM !== "h5" ? [
                    // 使用postcss-class-name 包将小程序不支持的类名写法转换为支持的类名，如："hover:xxx"
                    require("postcss-class-rename")({
                        "\\\\:": "-",
                        "\\\\/": "-",
                        "\\\\.": "-",
                        ".:": "tailwind",
                        "\\\*": "tailwind",
                    })
                ] : [
                    require("autoprefixer")({
                        remove: true,
                    }),
                ]
        ),
    ]
}
